/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2021-2022. All rights reserved.
 * Description: RDMA public macros.
 * Create: 2021-12-30
 */

#ifndef ROCE_CTX_FORMAT_H
#define ROCE_CTX_FORMAT_H

/* ********************** sync info ************************ */
#define ROCE_CACHE_LINE_SIZE (0x100)

#define ROCE_PAGE_SIZE 4096
#define ROCE_RC_ENTRY_NUM_PER_CACELINE 8

#define ROCE_GID_LEN 16

#define ROCE_LOCAL_DEFAULT_PMTU 5
#define ROCE_LOCAL_DEFAULT_MTU_CODE 0xf

enum {
    ROCE_QP_ST_RC = 0x0,  /* 000 */
    ROCE_QP_ST_UC = 0x1,  /* 001 */
    ROCE_QP_ST_RD = 0x2,  /* 010 */
    ROCE_QP_ST_UD = 0x3,  /* 011 */
    ROCE_QP_ST_XRC = 0x6, /* 110 */
    ROCE_QP_ST_PRIV = 0x7 /* 111 */
};

/* Description of parameters in the *********ROCE table ******* */
/* the same with stp */
enum ROCE_GID_TYPE_E {
    ROCE_GID_TYPE_V2_IPV4 = 0,
    ROCE_GID_TYPE_V2_IPV6 = 1,
    ROCE_GID_TYPE_V1 = 2
};

#endif /* ROCE_CTX_FORMAT_H */
